<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>
email_in.pl</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" title="style" type="text/css" href="./../../../style.css" media="all" >

</head>
  <body id="pod">
<p class="backlinktop"><b><a name="___top" href="index.html" accesskey="1" title="All Documents">&lt;&lt;</a></b></p>
<h1>email_in.pl</h1>
<div class='indexgroup'>
<ul   class='indexList indexList1'>
  <li class='indexItem indexItem1'><a href='#NAME'>NAME</a>
  <li class='indexItem indexItem1'><a href='#SYNOPSIS'>SYNOPSIS</a>
  <li class='indexItem indexItem1'><a href='#DESCRIPTION'>DESCRIPTION</a>
  <ul   class='indexList indexList2'>
    <li class='indexItem indexItem2'><a href='#Creating_a_New_Bug'>Creating a New Bug</a>
    <li class='indexItem indexItem2'><a href='#Modifying_an_Existing_Bug'>Modifying an Existing Bug</a>
    <ul   class='indexList indexList3'>
      <li class='indexItem indexItem3'><a href='#Adding%2FRemoving_CCs'>Adding/Removing CCs</a>
    </ul>
    <li class='indexItem indexItem2'><a href='#Errors'>Errors</a>
  </ul>
  <li class='indexItem indexItem1'><a href='#CAUTION'>CAUTION</a>
  <li class='indexItem indexItem1'><a href='#LIMITATIONS'>LIMITATIONS</a>
</ul>
</div>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="NAME"
>NAME</a></h1>

<p>email_in.pl - The Bugzilla Inbound Email Interface</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="SYNOPSIS"
>SYNOPSIS</a></h1>

<pre  class="code"> ./email_in.pl [-vvv] &#60; email.txt

 Reads an email on STDIN (the standard input).

  Options:
    --verbose (-v) - Make the script print more to STDERR.
                     Specify multiple times to print even more.</pre>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="DESCRIPTION"
>DESCRIPTION</a></h1>

<p>This script processes inbound email and creates a bug, or appends data to an existing bug.</p>

<h2><a class='u' href='#___top' title='click to go to top of document'
name="Creating_a_New_Bug"
>Creating a New Bug</a></h2>

<p>The script expects to read an email with the following format:</p>

<pre  class="code"> From: account@domain.com
 Subject: Bug Summary

 @product ProductName
 @component ComponentName
 @version 1.0

 This is a bug description. It will be entered into the bug exactly as
 written here.

 It can be multiple paragraphs.

 -- 
 This is a signature line, and will be removed automatically, It will not
 be included in the bug description.</pre>

<p>For the list of valid field names for the <code  class="code">@</code> fields, including a list of which ones are required, see <a href="./Bugzilla/WebService/Bug.html#create" class="podlinkpod"
>&#34;create&#34; in Bugzilla::WebService::Bug</a>. (Note, however, that you cannot specify <code  class="code">@description</code> as a field-- you just add a comment by adding text after the <code  class="code">@</code> fields.)</p>

<p>The values for the fields can be split across multiple lines, but note that a newline will be parsed as a single space, for the value. So, for example:</p>

<pre  class="code"> @summary This is a very long
 description</pre>

<p>Will be parsed as &#34;This is a very long description&#34;.</p>

<p>If you specify <code  class="code">@summary</code>, it will override the summary you specify in the Subject header.</p>

<p><code  class="code">account@domain.com</code> (the value of the <code  class="code">From</code> header) must be a valid Bugzilla account.</p>

<p>Note that signatures must start with &#39;-- &#39;, the standard signature border.</p>

<h2><a class='u' href='#___top' title='click to go to top of document'
name="Modifying_an_Existing_Bug"
>Modifying an Existing Bug</a></h2>

<p>Bugzilla determines what bug you want to modify in one of two ways:</p>

<ul>
<li>Your subject starts with [Bug 123456] -- then it modifies bug 123456.</li>

<li>You include <code  class="code">@id 123456</code> in the first lines of the email.</li>
</ul>

<p>If you do both, <code  class="code">@id</code> takes precedence.</p>

<p>You send your email in the same format as for creating a bug, except that you only specify the fields you want to change. If the very first non-blank line of the email doesn&#39;t begin with <code  class="code">@</code>, then it will be assumed that you are only adding a comment to the bug.</p>

<p>Note that when updating a bug, the <code  class="code">Subject</code> header is ignored, except for getting the bug ID. If you want to change the bug&#39;s summary, you have to specify <code  class="code">@summary</code> as one of the fields to change.</p>

<p>Please remember not to include any extra text in your emails, as that text will also be added as a comment. This includes any text that your email client automatically quoted and included, if this is a reply to another email.</p>

<h3><a class='u' href='#___top' title='click to go to top of document'
name="Adding/Removing_CCs"
>Adding/Removing CCs</a></h3>

<p>To add CCs, you can specify them in a comma-separated list in <code  class="code">@cc</code>.</p>

<p>To remove CCs, specify them as a comma-separated list in <code  class="code">@removecc</code>.</p>

<h2><a class='u' href='#___top' title='click to go to top of document'
name="Errors"
>Errors</a></h2>

<p>If your request cannot be completed for any reason, Bugzilla will send an email back to you. If your request succeeds, Bugzilla will not send you anything.</p>

<p>If any part of your request fails, all of it will fail. No partial changes will happen.</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="CAUTION"
>CAUTION</a></h1>

<p>The script does not do any validation that the user is who they say they are. That is, it accepts <i>any</i> &#39;From&#39; address, as long as it&#39;s a valid Bugzilla account. So make sure that your MTA validates that the message is actually coming from who it says it&#39;s coming from, and only allow access to the inbound email system from people you trust.</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="LIMITATIONS"
>LIMITATIONS</a></h1>

<p>The email interface only accepts emails that are correctly formatted per RFC2822. If you send it an incorrectly formatted message, it may behave in an unpredictable fashion.</p>

<p>You cannot send an HTML mail along with attachments. If you do, Bugzilla will reject your email, saying that it doesn&#39;t contain any text. This is a bug in <a href="./Email/MIME/Attachment/Stripper.html" class="podlinkpod"
>Email::MIME::Attachment::Stripper</a> that we can&#39;t work around.</p>

<p>You cannot modify Flags through the email interface.</p>
<p class="backlinkbottom"><b><a name="___bottom" href="index.html" title="All Documents">&lt;&lt;</a></b></p>

<!-- end doc -->

</body></html>
